<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
</head>
<body>
<div id="app" class="securityCenter">
    <include file="./public/header.html"/>

    <div class="container containerUser fix pt15" s="[object Object]">
        <div class="slideUser">
            <ul class="sildeSession"><h3><span></span>账号管理</h3>
                <li class=""><a href="./personalInfo.html">个人信息</a></li>
                <li class="curr"><a href="./securityCenter.html">安全中心</a></li>
                <li class=""><a href="./manageBankcard.html">银行卡管理</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>投注管理</h3>
                <li><a href="./BetRecord.html" class="">投注记录</a></li>
                <li><a href="./seekOrder.html" class="">追号记录</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>资金管理</h3>
                <li><a href="./BillRecord.html" class="">交易记录</a></li>
                <li class=""><a href="./PLstatement.html">今日盈亏</a></li>
            </ul>
            <ul class="sildeSession">
                <h3><span></span>代理中心</h3>
                <li><a href="{:U('Users/agentIntro')}" class="">代理说明</a></li>
                <li class=""><a href="{:U('Users/agentReport')}">代理报表</a></li>
                <li><a href="{:U('Users/lowerReport')}" class="">下级报表</a></li>
                <li class=""><a href="{:U('Users/manageInvite')}">下级开户</a></li>
                <li><a href="{:U('Users/agentMember')}" class="">会员管理</a></li>
                <li><a href="{:U('Users/agentBetRecord')}" class="">投注明细</a></li>
                <li><a href="{:U('Users/agentBillRecord')}" class="">交易明细</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>消息管理</h3>
                <li><a href="./letter.html" class="">站内信</a></li>
                <li><a href="./Notice.html" class="">网站公告</a></li>
            </ul>
        </div>


        <div class="userRight">
            <input type="hidden" class="uid" value="{$uid}">
            <div class="userTitle mgb10">下级开户</div>
            <div class="userMain openAgent">
                <div class="newTab">
                    <a href="{:U('Users/manageInvite')}" class="curr curr">下级开户</a>
                    <a href="{:U('Users/manageIcode')}" class="">邀请码管理</a>
                </div>
                <div data-id="1" data-title="" class="TabLi">
                    <ul class="searchFirst">
                        <li><span>开户类型：</span>
                            <a href="javascript:;" class="userSearch <?php if($leixing=='1'){echo '111111';}; ?> active" data-value="1">代理</a>
                            <a href="javascript:;" class="userSearch <?php if($leixing=='2'){echo '222222';}; ?> " data-value="2">玩家</a> <br>
                            返点设置：请先为下级设置返点。
                            <a class="rebateDesLink fx_wf_btn">点击查看返点赔率表</a>
                        </li>
                    </ul>
                    <div id="NextOpen" class="bonusTable">
                        <ul>
                            <li>时时彩</li>
                            <li>
                                <input type="number" name="SSC" id="ssc" tag="时时彩返点" placeholder="" min="0.0" step="0.1"
                                       max="<?php echo sprintf('%.1f',$arr['ssc']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf("%.1f",$arr['ssc']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['ssc']);?>）</span>
                            </li>
                        </ul>
                        <ul>
                            <li>快3</li>
                            <li><input type="number" name="K3" id="k3" tag="快3返点" placeholder="" min="0.0" step="0.1"
                                       max="<?php echo sprintf('%.1f',$arr['k3']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf("%.1f",$arr['k3']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['k3']);?>）</span></li>
                        </ul>
                        <ul>
                            <li>11选5</li>
                            <li><input type="number" name="SYX5" id="x11_5" tag="11选5返点" placeholder="" min="0.0"
                                       step="0.1" max="<?php echo sprintf('%.1f',$arr['x11_5']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf("%.1f",$arr['x11_5']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['x11_5']);?>）</span>
                            </li>
                        </ul>
                        <ul>
                            <li>福彩3D</li>
                            <li><input type="number" name="FC3D" id="f3d" tag="福彩3D返点" placeholder="" min="0.0"
                                       step="0.1" max="<?php echo sprintf('%.1f',$arr['fc3d']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf('%.1f',$arr['fc3d']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['fc3d']);?>）</span>
                            </li>
                        </ul>
                        <ul>
                            <li>排列3/5</li>
                            <li><input type="number" name="PL35" id="pl_35" tag="排列3/5返点" placeholder="" min="0.0"
                                       step="0.1" max="<?php echo sprintf('%.1f',$arr['pl3_5']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf('%.1f',$arr['pl3_5']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['pl3_5']);?>）</span>
                            </li>
                        </ul>
                        <ul>
                            <li>北京快乐8</li>
                            <li><input type="number" name="KL8" id="kl8" tag="北京快乐8返点" placeholder="" min="0.0"
                                       step="0.1" max="<?php echo sprintf('%.1f',$arr['kl8']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf("%.1f",$arr['kl8']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['kl8']);?>）</span>
                            </li>
                        </ul>
                        <ul>
                            <li>北京PK10</li>
                            <li><input type="number" name="PK10" id="pk10" tag="北京PK10返点" placeholder="" min="0.0"
                                       step="0.1" max="<?php echo sprintf('%.1f',$arr['pk10']);?>" class="userInput mgl20">&nbsp;
                                <span>（自身返点<?php echo sprintf("%.1f",$arr['pk10']);?>，可为下级设置返点范围0.0-<?php echo sprintf("%.1f",$arr['pk10']);?>）</span>
                            </li>
                        </ul>
                    </div>
                    <a class="submitBtn" onclick="sav()">生成邀请码</a>

                    <div class="userTip mg30">
                        <p>※ 温馨提示：
                            <br> 1、不同的返点赔率不同，返点越高赔率越高。
                            <br> 2、代理可获得的佣金等于代理自身返点与下级返点的差值，如代理自身返点6，下级返点4，代理可获得下级投注金额的2%，即下级下注100元，代理可获得2元。
                            <br> 3、下级返点值设得越低，下级的赔率就越低，建议给下级设置的返点不要过低。
                        </p>
                    </div>

                    <div id="ssc1" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">时时彩返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="ssc2" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">时时彩返点范围必须在0.0-<?php echo sprintf("%.1f",$arr['ssc']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="k31" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">快3返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="k32" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">快3返点范围必须在0.0-<?php echo sprintf("%.1f",$arr['k3']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="x11_51" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">11选5返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="x11_52" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">11选5返点范围必须在0.0-<?php echo sprintf("%.1f",$arr['x11_5']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="fc3d1" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">福彩3D返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="fc3d2" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">福彩3D返点范围必须在0.0-<?php echo sprintf('%.1f',$arr['fc3d']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="pl351" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">排列3/5返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="pl352" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">排列3/5返点范围必须在0.0-<?php echo sprintf('%.1f',$arr['pl3_5']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="kl81" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">北京快乐8返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="kl82" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">北京快乐8返点范围必须在0.0-<?php echo sprintf("%.1f",$arr['kl8']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="pk101" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">北京PK10返点不能为空</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="pk102" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">北京PK10返点范围必须在0.0-<?php echo sprintf("%.1f",$arr['pk10']);?>之间</div>
                                    <div class="layermbtn"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--邀请码生成-->
                    <div id="code" class="layermbox layermbox0 layermshow" index="10">
                        <div class="laymshade"></div>
                        <div class="layermmain">
                            <div class="section">
                                <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                                    <button class="layermend"></button>
                                    <div class="layermcont">·邀请码已生成，请点击邀请码管理进行查询·</div>
                                    <div class="layermbtn layermbtn_1"><span type="1">确定</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
    <include file="./public/footer.html"/>
</div>


<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
    $(".searchFirst .userSearch").click(function () {
        $(this).addClass("active").siblings(".userSearch").removeClass("active");
        var dat = $(this).data("value");
    })
</script>
<script>
   var uid = $(".uid").val();
   if(uid != ''){
       $(".fx_wf_btn").click(function () {
           //设置居中./rebateDes_K3.html
           var wl = ($(window).width() - 1020) / 2;
           window.open("{:U('Users/re_k3')}", "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=1020, height=600,top=100,left=" + wl);
       })
   }

</script>
</body>
</html>
<script>
    function sav() {
        //获取最大值
        var sscc = $("#ssc").attr("max");
        var kk3 = $("#k3").attr("max");

        var xx11_5 = $("#x11_5 ").attr("max");
        var fc3d = $("#f3d").attr("max");
        var ppl_35 = $("#pl_35").attr("max");
        var kkl8 = $("#kl8").attr("max");
        var ppk10 = $("#pk10").attr("max");

        //获取输入的值
        var type = $('.userSearch.active').data("value");
        var ssc = $('#ssc').val();
        var k3 = $('#k3').val();
        var x11_5 = $('#x11_5').val();
        var f3d = $('#f3d').val();
        var pl_35 = $('#pl_35').val();
        var kl8 = $('#kl8').val();
        var pk10 = $('#pk10').val();

        //判断不能为空
        if (ssc == "") {
            $("#ssc1").show();
            return false;
        }
        if(ssc<0 || ssc>sscc){
            $("#ssc2").show();
            return false;
        }

        if (k3 == "") {
            $("#k31").show();
            return false;
        }
        if(k3<0 || k3>kk3){

            $("#k32").show();
            return false;
        }
        if (x11_5 == "") {
            $("#x11_51").show();
            return false;
        }
        if(x11_5<0 || x11_5>xx11_5){
            $("#x11_52").show();
            return false;
        }
        if (f3d == "") {
            $("#fc3d1").show();
            return false;
        }
        if(f3d<0 || f3d>fc3d){
            $("#fc3d2").show();
            return false;
        }
        if (pl_35 == "") {
            $("#pl351").show();
            return false;
        }
        if(pl_35<0 || pl_35>ppl_35){
            $("#pl352").show();
            return false;
        }
        if (kl8 == "") {
            $("#kl81").show();
            return false;
        }
        if(kl8<0 || kl8>kkl8){
            $("#kl82").show();
            return false;
        }
        if (pk10 == "") {
            $("#pk101").show();
            return false;
        }
        if(pk10<0 || pk10>ppk10){
            $("#pk102").show();
            return false;
        }
        $.ajax({
           type:"POST" ,
            url:"{:U('Users/manageInvite')}",
            data:{'type':type,'ssc':ssc,'k3':k3,'x11_5':x11_5,'f3d':f3d,'pl_35':pl_35,'kl8':kl8,'pk10':pk10},
            success:function(dat){
                if(dat=='1'){
                   $("#code").show();
                }
            }
        });
    }


    $(".layermbtn").click(function () {
        $("#ssc1").hide();
        $("#k31").hide();
        $("#x11_51").hide();
        $("#fc3d1").hide();
        $("#pl351").hide();
        $("#kl81").hide();
        $("#pk101").hide();
    });
    $(".layermbtn_1").click(function (){
        $("#code").hide(function(){
            window.location.href = "/Users/manageIcode";
        });
    })


    $(function(){
        setInterval(function(){
            $.ajax({
                type:"POST" ,
                url:"{:U('Users/shuax')}"
            });
        },1200000)
    })


</script>